//
//  UIViewController+VRSlideMenu.m
//  MyDemos
//
//  Created by Veer on 16/8/24.
//  Copyright © 2016年 veer. All rights reserved.
//

#import "UIViewController+VRSlideMenu.h"

#import "VRSlideMenuViewController.h"

@implementation UIViewController (VRSlideMenu)

- (VRSlideMenuViewController *)slideMenuController
{
    
    UIViewController *parentVc = self.parentViewController;
    while (parentVc) {
        if ([parentVc isKindOfClass:[VRSlideMenuViewController class]]) {
            
            return (VRSlideMenuViewController *)parentVc;
        }else if(parentVc.parentViewController && parentVc.parentViewController !=
            parentVc){
            
            parentVc = parentVc.parentViewController;
        }else{
            
            parentVc = nil;
        }
    }
    return nil;
}

@end
